package com.lmind.support.web;

import java.util.Enumeration;

import javax.servlet.ServletContext;
import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpSessionContext;

@SuppressWarnings({"rawtypes", "deprecation"})
public abstract class HttpSessionAdapter implements HttpSession {

	@Override
	public long getCreationTime() {
		return getHttpSession().getCreationTime();
	}

	@Override
	public String getId() {
		return getHttpSession().getId();
	}

	@Override
	public long getLastAccessedTime() {
		return getHttpSession().getLastAccessedTime();
	}

	@Override
	public ServletContext getServletContext() {
		return getHttpSession().getServletContext();
	}

	@Override
	public void setMaxInactiveInterval(int interval) {
		getHttpSession().setMaxInactiveInterval(interval);
	}

	@Override
	public int getMaxInactiveInterval() {
		return getHttpSession().getMaxInactiveInterval();
	}

	@Override
	public HttpSessionContext getSessionContext() {
		return getHttpSession().getSessionContext();
	}

	@Override
	public Object getAttribute(String name) {
		return getHttpSession().getAttribute(name);
	}

	@Override
	public Object getValue(String name) {
		return getHttpSession().getValue(name);
	}

	@Override
	public Enumeration getAttributeNames() {
		return getHttpSession().getAttributeNames();
	}

	@Override
	public String[] getValueNames() {
		return getHttpSession().getValueNames();
	}

	@Override
	public void setAttribute(String name, Object value) {
		getHttpSession().setAttribute(name, value);
	}

	@Override
	public void putValue(String name, Object value) {
		getHttpSession().putValue(name, value);
	}

	@Override
	public void removeAttribute(String name) {
		getHttpSession().removeAttribute(name);
	}

	@Override
	public void removeValue(String name) {
		getHttpSession().removeValue(name);
	}

	@Override
	public void invalidate() {
		getHttpSession().invalidate();
	}

	@Override
	public boolean isNew() {
		return getHttpSession().isNew();
	}
	
	protected abstract HttpSession getHttpSession();

}
